<template>
  <RouterView />
</template>

<script>
import { useRouter, useRoute } from "vue-router";
import { useFunc } from "@/hook/useFunc";
import { projectFunc } from "@/hook/projectFunc";
import app from "../public/app/aplication"

export default {
  name: "App",

  mounted() {
    document.body.style.setProperty('--el-font-size-base', '20px');
    document.body.style.setProperty('--el-component-size-large', '66px');
    document.body.style.setProperty('--el-component-size-default', '40px');

    document.body.style.setProperty('--el-color-primary', '#26E5FD');
    document.body.style.setProperty('--el-fill-color-light', '#30496f');
    document.body.style.setProperty('--el-checkbox-input-height', '30px');
    document.body.style.setProperty('--el-checkbox-input-width', '30px');
    


    // document.body.style.setProperty('--el-color-primary-light-3', '#EC9727');
    // document.body.style.setProperty('--el-color-primary-dark-2', '#EC9727 ');
    // document.body.style.setProperty('--el-fill-color-light', 'rgba(20, 67, 81, 0.90) ');
  },
  //解决页面刷新时出现store数据全部丢失的问题。
  created() {
    
    const clientId = import.meta.env.VITE_APP_clientId; // 由服务方分配的客户端ID
    const redirect_uri = import.meta.env.VITE_APP_redirectUrl;
    // const redirect_uri = app.redirectUrl;
    const ipPort = import.meta.env.VITE_APP_ipPort;
    const queryParams = new URLSearchParams(window.location.search);
    let code = queryParams.get("code");
    console.log(code,redirect_uri, "redirect_uri+code");
    let judge=import.meta.env.VITE_APP_judegecode
    // console.log(judge,'import.meta.VITE_APP_judegecode');

    if(judge){
    if(judge==='false')return
      if (!code) {
      const authUrl = `${ipPort}agcloud-sso/oauth/authorize?client_id=${clientId}&response_type=code&redirect_uri=${redirect_uri}`;
    
      console.log(authUrl, "authUrl");
      window.open(authUrl, "_self");
    } else {
      let token=projectFunc().getToken(code)
      console.log(token,'tokenwdwdw');
    }
    }

  },
};
</script>
<style lang="less">
/*css主要部分的样式*/
/*定义滚动条宽高及背景，宽高分别对应横竖滚动条的尺寸*/
.el-button + .el-button {
  margin: 0px;
}
.el-table{
  height: 100% !important;
}
::-webkit-scrollbar {
  width: 10px; /*对垂直流动条有效*/
  height: 10px; /*对水平流动条有效*/
}

/*定义滚动条的轨道颜色、内阴影及圆角*/
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgb(206 182 182 / 30%);
  border-radius: 0px;
}

/*定义滑块颜色、内阴影及圆角*/
::-webkit-scrollbar-thumb {
  border-radius: 8px;
  -webkit-box-shadow: inset 0 0 6px #f1f1f1;
  background-color: #f1f1f1;
}

/*定义两端按钮的样式*/
::-webkit-scrollbar-button {
  display: none;
}
::-webkit-scrollbar {
  display: none;
}
/*定义右下角汇合处的样式*/
::-webkit-scrollbar-corner {
  display: none;
}
.el-input__wrapper {
  font-size: 20px;

  background-color: transparent !important;
  box-shadow: none !important;
}
.el-input__inner {
  color: #DAF5FA !important;

  background: transparent !important;
}
 .el-table thead.is-group th.el-table__cell {
  background: transparent;

}
 .esri-view-surface {
    /* 添加您的自定义样式 */
    width: 7072px  !important ;
  height: 1560px !important ;
    /* 其他样式 */
}

.el-table__body tr.current-row > td.el-table__cell {
  background-color: transparent !important;
}

.el-table--striped
.el-table__body
tr.el-table__row--striped.current-row
td.el-table__cell {
  background-color: transparent;
}
// 表头颜色
.el-table {
     background-color: transparent !important;
   }
.el-table tr {
  background-color: transparent !important;
}
.el-table__header-wrapper {
  background-color: transparent !important;
}

.el-table__body {
  background-color: transparent !important;
}
.el-table--enable-row-hover .el-table__body tr:hover > td.el-table__cell {
  background-color: rgba(185, 21, 21, 0) !important;
}
.el-table{
  height: 100% !important;
}
.el-table__body-wrapper {
  overflow: auto !important;
}
.el-table__row .current-row {
  background-color: transparent !important;
}
//斑马纹
.el-table--striped
.el-table__body
tr.el-table__row--striped
td.el-table__cell {
  background: rgba(20, 67, 81, 0.9) !important; /* 你的自定义颜色 */
}
//下划线透明
.el-table td.el-table__cell {
  border-bottom: none !important;
}
.el-table th.el-table__cell.is-leaf {
  border-bottom: none !important;
}

.el-table thead.is-group th.el-table__cell {
  background: transparent;
  //  border-top: 1px solid black;
}

.el-select-dropdown{
  background-color:#154151 !important;
}
.el-select-dropdown__item {
    background-color: #154151 !important;
    color: #DAF5FA !important;
}

.el-select-dropdown__item.selected:hover {
  background-color:#37aeda !important

}
.el-select-dropdown__item.hover {
  background-color:#37aeda !important
}
.el-select-dropdown__item.selected {
  background-color:#154151 !important;
  color: #5ce1ff !important; 

}
.el-tree-node__content {

  height: 38px  !important ;
}

</style>

<style scoped lang="less">
.el-message {
  height: 40px;
  min-width: 180px;
  background-color: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
  border-radius: 7px;
}
:depp .el-select {
}
 .el-select-dropdown__item {
  background-color:#42b983
}
:deep .el-select-dropdown__item:hover {
  // color: rgba(20, 67, 81, 0.90);
}
:deep .el-select-dropdown__wrap.el-scrollbar__wrap.el-scrollbar__wrap--hidden-default{
  background: #032332;
}
// el select背景色设置
:deep .el-input__inner {
  color: rgba(230, 253, 255, 1) !important;

  background: transparent !important;
}
:deep .el-input__wrapper {
  font-size: 20px;

  background-color: transparent !important;
  box-shadow: none !important;
}
:deep .el-select-dropdown__item{
  font-size: 20px;

}
:deep .el-select-dropdown {
  background: rgba(21, 43, 94, 0.3);

  margin: 0px;

  border: 0px;

  border-radius: 0px;

  left: 0px !important;
}
:deep .el-select-dropdown {
  background-color: #42b983 !important;
}

:deep .el-scrollbar {
  overflow: auto !important;
}

// :deep .el-table__body-wrapper {
//   // overflow-y: auto;
//   overflow: hidden;
// }
:deep .el-menu-item.is-active {
  background-color: transparent;
}
:deep .el-menu-item:hover {
  background-color: transparent;
}

:deep .el-popper.is-dark {
  width: 200px;
}


::v-deep .esri-view-surface {
    /* 添加您的自定义样式 */
    width: 7072px  !important ;
  height: 1560px !important ;
    /* 其他样式 */
}

::v-deep .esri-view-surface--touch-none {
    /* 添加您的自定义样式 */
    width: 7072px  !important ;
  height: 1560px !important ;
    /* 其他样式 */
}
.el-aside::-webkit-scrollbar {
  display: none;
}

::-webkit-scrollbar {
  width: 10px;
  /*对垂直流动条有效*/
  height: 10px;
  /*对水平流动条有效*/
}

/*定义滚动条的轨道颜色、内阴影及圆角*/
::-webkit-scrollbar-track {
  -webkit-box-shadow: inset 0 0 6px rgb(206 182 182 / 30%);
  border-radius: 0px;
}

/*定义滑块颜色、内阴影及圆角*/
::-webkit-scrollbar-thumb {
  border-radius: 8px;
  -webkit-box-shadow: inset 0 0 6px #f1f1f1;
  background-color: #f1f1f1;
}

/*定义两端按钮的样式*/
::-webkit-scrollbar-button {
  display: none;
}

/*定义右下角汇合处的样式*/
::-webkit-scrollbar-corner {
  display: none;
}

* {
  margin: 0px;
  padding: 0px;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

#app {
  width: 100%;
  height: 100%;
  // min-width: 1366px;
  // min-height: 680px;
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  overflow: hidden;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}

html {
  width: 100%;
  height: 100%;
}

body {
  width: 100%;
  height: 100%;
}
</style>
